<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="resource/js/jquery-3.2.1.js"></script>
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
	function dl(){
		$.post(
			"login",
			$("form").serialize(),
			function(msg){
				if (msg) {
					alert("登录成功");
					location.href="list";
				}else {
					alert("登录失败");
					location.reload();
				}
			},"json"
		)
	}
</script>
<form action="login" method="post">
	用户名<input type="text" name="name"><br>
	密码<input type="text" name="password"><br>
	<input type="button" value="登录" onclick="dl()">
</form>
</body>
</html>